/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;


import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * <p>Project: javase - Date1
 * <p>Powered by webrx On 2021-11-23 14:07:19
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Date1 {
    public static void main(String[] args) {
        //java.util.Date
        //1637648060786
        Date d = new Date();
        System.out.println(d.getTime());

        //java.util.Calendar
        Calendar c = Calendar.getInstance();
        System.out.println(c.getTimeInMillis());

        //系统时间戳，是一个long整数
        long time = System.currentTimeMillis();
        System.out.println(time);

        //格式化，字符串与日期对象的转换的
        SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");

    }
}
